package com.isoft.systemprovidor.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.isoft.systemprovidor.bean.ResponseData;
import com.isoft.systemprovidor.entity.MyApproval;
import com.isoft.systemprovidor.entity.MyMessage;
import com.isoft.systemprovidor.service.MyMessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
@Slf4j
@RequestMapping("/systemprovidor/mymessage")
public class MyMessageController extends BaseController{
    @Autowired
    MyMessageService myMessageService;
    /*分页获取分页我的消息数据*/
    @GetMapping("/getallmymessage")
    public Page<MyMessage> getallMyMessagePage(Integer current , Integer size , String sysuserid){
        return myMessageService.getallMyMessagePage(current , size , sysuserid);
    }
    /*查询我的消息的未读*/
    @GetMapping("/unread")
    public ResponseData<Object> UnreadNum(String sysuserid){
        return returnObject(myMessageService.UnreadNum(sysuserid));
    }
}
